package logic

import (
	"context"
	"video-joy/models/mysql"

	"video-joy/userrpc/internal/svc"
	"video-joy/userrpc/userrpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type CollectionListLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewCollectionListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CollectionListLogic {
	return &CollectionListLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 收藏列表
func (l *CollectionListLogic) CollectionList(in *userrpc.CollectionListRequest) (*userrpc.CollectionListResponse, error) {
	// todo: add your logic here and delete this line

	list := mysql.CollectionList(mysql.DB, in)

	return &userrpc.CollectionListResponse{
		List: list,
	}, nil
}
